<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简历分析 - AI助手</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
    <!-- Bootstrap Icons -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
    
    <!-- JavaScript -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    <script src="/js/main.js"></script>
    <style>
        /* CSS变量定义 */
        :root {
            --primary-gradient: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
            --primary-color: #4e73df;
            --secondary-color: #224abe;
            --success-color: #1cc88a;
            --danger-color: #e74a3b;
            --warning-color: #f6c23e;
            --info-color: #36b9cc;
            --text-color: #333;
            --text-muted: #6c757d;
            --white: #ffffff;
            --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.05);
            --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.1);
            --border-radius: 12px;
        }
        
        /* 基础样式 */
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background-color: #f8f9fa;
            min-height: 100vh;
            margin: 0;
            display: flex;
            flex-direction: column;
        }
        
        /* 导航栏样式 */
        .navbar {
            background: var(--primary-gradient);
            box-shadow: var(--shadow-md);
            position: sticky;
            top: 0;
            z-index: 1030;
            transition: all 0.3s ease;
        }
        
        .navbar:hover {
            box-shadow: var(--shadow-lg);
        }
        
        .navbar-brand {
            font-weight: 700;
            font-size: 1.25rem;
            transition: transform 0.3s ease;
        }
        
        .navbar-brand:hover {
            transform: scale(1.05);
        }
        
        .nav-link {
            color: rgba(255, 255, 255, 0.9) !important;
            font-weight: 500;
            position: relative;
            transition: all 0.3s ease;
            padding: 0.5rem 1rem;
        }
        
        .nav-link:hover {
            color: var(--white) !important;
            transform: translateY(-2px);
        }
        
        .nav-link::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 2px;
            background-color: var(--white);
            transition: width 0.3s ease;
        }
        
        .nav-link:hover::after,
        .nav-link.active::after {
            width: 80%;
        }
        
        .nav-link.active {
            color: var(--white) !important;
            font-weight: 600;
        }
        
        /* 主内容区样式 */
        .container {
            flex: 1;
            padding-top: 2rem;
            padding-bottom: 2rem;
        }
        
        /* 卡片样式 */
        .card {
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-lg);
            overflow: hidden;
            border: none;
            transition: all 0.3s ease;
            margin-bottom: 2rem;
        }
        
        .card:hover {
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
            transform: translateY(-5px);
        }
        
        .card-header {
            background: var(--primary-gradient);
            color: var(--white);
            padding: 1.5rem;
            border-radius: var(--border-radius) var(--border-radius) 0 0;
            position: relative;
            overflow: hidden;
        }
        
        .card-header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
            transform: rotate(45deg);
            animation: shimmer 3s infinite;
        }
        
        @keyframes shimmer {
            0% {
                transform: rotate(45deg) translateX(-100%);
            }
            100% {
                transform: rotate(45deg) translateX(100%);
            }
        }
        
        .card-body {
            padding: 2rem;
            background-color: var(--white);
        }
        
        /* 表单样式 */
        .form-label {
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 0.5rem;
            display: block;
        }
        
        .form-control {
            border-radius: 8px;
            border: 1px solid #cbd5e1;
            transition: all 0.3s ease;
            padding: 0.75rem 1rem;
            font-size: 1rem;
            background-color: var(--white);
        }
        
        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.25);
            outline: none;
        }
        
        .form-control::placeholder {
            color: var(--text-muted);
            opacity: 0.7;
        }
        
        /* 文件上传样式 */
        input[type="file"] {
            border: 2px dashed #cbd5e1;
            border-radius: 8px;
            padding: 1rem;
            transition: all 0.3s ease;
            background-color: #f8fafc;
        }
        
        input[type="file"]:hover {
            border-color: var(--primary-color);
            background-color: #f1f5f9;
        }
        
        input[type="file"]::file-selector-button {
            background: var(--primary-gradient);
            color: var(--white);
            border: none;
            border-radius: 6px;
            padding: 0.5rem 1rem;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.3s ease;
        }
        
        input[type="file"]::file-selector-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(78, 115, 223, 0.3);
        }
        
        /* 按钮样式 */
        .btn-primary {
            background: var(--primary-gradient);
            border: none;
            border-radius: 8px;
            padding: 0.75rem 1.5rem;
            font-weight: 600;
            font-size: 1rem;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            position: relative;
            overflow: hidden;
        }
        
        .btn-primary::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: all 0.5s ease;
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
            background: linear-gradient(135deg, #224abe 0%, #4e73df 100%);
        }
        
        .btn-primary:hover::before {
            left: 100%;
        }
        
        .btn-primary:active {
            transform: translateY(0);
        }
        
        /* 提示框样式 */
        .alert {
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1.5rem;
            border: none;
            box-shadow: var(--shadow-sm);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .alert i {
            flex-shrink: 0;
        }
        
        /* 页脚样式 */
        footer {
            background-color: #343a40;
            color: var(--white);
            padding: 2rem 0;
            margin-top: auto;
        }
        
        /* 动画 */
        .fade-in {
            animation: fadeIn 0.8s ease-in-out;
            opacity: 0;
            animation-fill-mode: forwards;
        }
        
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        /* 响应式设计 */
        @media (max-width: 992px) {
            .navbar-nav {
                margin-top: 1rem;
            }
            
            .card {
                margin-bottom: 1.5rem;
            }
            
            .card-body {
                padding: 1.5rem;
            }
        }
        
        @media (max-width: 576px) {
            .container {
                padding-top: 1rem;
                padding-bottom: 1rem;
            }
            
            .card-body {
                padding: 1rem;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark shadow-lg">
        <div class="container">
            <a class="navbar-brand font-weight-bold" href="/home">
                <i class="bi bi-robot mr-2"></i>AI面试助手
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="/home">
                            <i class="bi bi-house-door mr-1"></i> 首页
                        </a>
                    </li>
                    <li class="nav-item active">
                        <a class="nav-link" href="/resume/analysis">
                            <i class="bi bi-file-text mr-1"></i> 简历分析
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/interview/prepare">
                            <i class="bi bi-play-circle mr-1"></i> 开始面试
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/interview/history">
                            <i class="bi bi-clock-history mr-1"></i> 面试历史
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/user/management">
                            <i class="bi bi-people mr-1"></i> 用户管理
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/logout">
                            <i class="bi bi-box-arrow-right mr-1"></i> 退出登录
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <!-- 主内容区 -->
    <div class="container">
        <div class="row justify-content-center mb-6">
            <div class="col-lg-8 col-md-10">
                <!-- 简历分析卡片 -->
                <div class="card fade-in">
                    <div class="card-header">
                        <h2 class="mb-0 text-center">
                            <i class="bi bi-file-text mr-2"></i> 简历分析
                        </h2>
                    </div>
                    <div class="card-body">
                        <form th:action="@{/resume/analyze}" method="post" enctype="multipart/form-data">
                            <div class="mb-4">
                                <label for="file" class="form-label">上传简历文件 (支持DOCX/PDF格式)</label>
                                <input type="file" class="form-control mt-2" id="file" name="file" accept=".docx,.pdf">
                                <small class="form-text text-muted mt-1">或者可以直接粘贴简历内容到下方文本框</small>
                            </div>
                            
                            <div class="mb-4">
                                <label for="resumeText" class="form-label">简历内容</label>
                                <textarea class="form-control" id="resumeText" name="resumeText" placeholder="请粘贴您的简历内容..." rows="10" oninput="this.style.height = 'auto'; this.style.height = (this.scrollHeight) + 'px';"></textarea>
                                <small class="form-text text-muted mt-1">请确保您的简历包含个人基本信息、教育背景、工作经历和技能等内容，以便AI进行准确分析。</small>
                            </div>
                            
                            <div class="mb-4">
                                <label for="jobTitle" class="form-label">目标岗位（可选）</label>
                                <input type="text" class="form-control" id="jobTitle" name="jobTitle" placeholder="例如：前端开发工程师、产品经理、数据分析师等">
                                <small class="form-text text-muted mt-1">输入目标岗位可以获得更有针对性的分析和建议。</small>
                            </div>
                            
                            <div class="mb-4">
                                <label for="jobDescription" class="form-label">岗位描述（可选）</label>
                                <textarea class="form-control" id="jobDescription" name="jobDescription" placeholder="请简要描述该岗位的职责和要求..." rows="3"></textarea>
                                <small class="form-text text-muted mt-1">提供岗位描述可以让分析结果更加精准。</small>
                            </div>
                            
                            <div class="text-center">
                                <button type="submit" class="btn btn-primary">
                                    <i class="bi bi-lightbulb mr-2"></i> 分析简历
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <div class="row">
                <div class="col-12 text-center">
                    <p class="mb-2">&copy; 2023 AI面试助手. 保留所有权利。</p>
                </div>
            </div>
        </div>
    </footer>

    <!-- 脚本 -->
    <script>
        // 文件上传后自动调整文本区域大小
        document.addEventListener('DOMContentLoaded', function() {
            // 初始化文本区域高度
            const textarea = document.getElementById('resumeText');
            if (textarea) {
                textarea.style.height = 'auto';
                textarea.style.height = (textarea.scrollHeight) + 'px';
            }
        });
    </script>
</body>
</html>